
import AbsMenu from '../absmenu.js'

class ViewMenu extends AbsMenu.AbsMenu {
    constructor(map, item) {
        super(map, item);
    }

    act2Click() {
        console.log("view-----+" + this.menuSubItem);
        switch (this.menuSubItem) {
            case 'addpage':
                this.addPage();
                break;

            default:
                break;
        }
    }

    addPage() {
        let canvasTab = document.getElementById("canvasTabID");
        if (!canvasTab) {
            return;
        }

        let list = window.canvasList.value;
        let length = list.length + 1;
        let id = length + 1;
        let canvasID = "paintCanvas#"+id;
        let tabName = '#'+id;
        let t = {name:tabName,text:tabName,id,canvasID,mapCtrlPtr:null};
        list.push(t);
    }
}

export default { ViewMenu }

